﻿@model ArticleListVM

@{
    ViewBag.Title = "新闻资讯";
}



<div class="container">
    <nav class="navbar navbar-default">
        <form class="navbar-form navbar-left">
            <div class="form-group">
                <label for="Keyword">关键字</label>
                @Html.TextBoxFor(model => model.Keyword, new { @class = "form-control" })
                @Html.DropDownListFor(model => model.CategoryId, (IEnumerable<SelectListItem>)ViewBag.Categories, Labels.Category + "过滤", new { @class = "form-control" })
            </div>
            <button type="submit" class="btn btn-primary"><i class="fa fa-search fa-fw"></i>查找</button>
        </form>

    </nav>
</div>

<div class="container">
    <div class="row">
        @foreach (var item in Model.Articles)
        {
            @Html.Partial("_SingleArticle", item)
        }
    </div>

</div>


<footer class="container">
    <div class="row">
        <div class="col-sm-7">
            @Html.PagedListPager((IPagedList)Model.Articles, page => Url.Action("Index", new { page, keyword = Model.Keyword, categoryId = Model.CategoryId }))
        </div>
        <div class="col-sm-5">
            <div class="text-right form-inline hidden">
                总计 @Model.TotalCount 条
            </div>
        </div>
    </div>
</footer>


